home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
cstdio.arc
/
SRC.ARC
/
STRLEN.A
< prev
next >
Wrap
Text File
|
1985-08-20
|
430b
|
24 lines
; strlen.a - return length of string.
; (C) Copyright 1985 Cray Research Inc. - All Rights Reserved.
; G. R. Mansfield. 85/08/20.
; Ver 1.0-5820.
cseg
public strlen_
; int strlen(s) /* return length of string s */
; char *s;
strlen_:
mov bx,sp
mov si,[bx+2] ; s
mov cx,-1
stl1: lodsb ; next character in s
inc cx
or al,al
jnz stl1 ; loop to end of string
xchg ax,cx ; return length
ret